package cn.lingyangwl.agile.auth.model.rqrs.third;

import lombok.*;

/**
 * 获取微信openId请求
 * @author shenguangyang
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WxMpLoginReq extends ThirdLoginReq {
    private static final String CODE = "code";
    private static final String STATE = "state";

    private String code;

    private String state;


//    public WxMpLoginReq checkParams(HttpServletRequest request) {
//        MultiValueMap<String, String> parameters = OAuth2Utils.getParameters(request);
//        this.code = parameters.getFirst(CODE);
//        if (StringUtils.isEmpty(this.code)) {
//            OAuth2Utils.throwError(OAuth2ErrorCodes.INVALID_REQUEST, CODE,
//                    OAuth2Utils.ACCESS_TOKEN_REQUEST_ERROR_URI);
//        }
//
//        state = parameters.getFirst(STATE);
//        if (StringUtils.isEmpty(state)) {
//            OAuth2Utils.throwError(OAuth2ErrorCodes.INVALID_REQUEST, STATE,
//                    OAuth2Utils.ACCESS_TOKEN_REQUEST_ERROR_URI);
//        }
//
//        backUrl = parameters.getFirst(BACK_URL);
//        return this;
//    }
}
